Skip to content

feat(galadon): add the five-stage engineering loop plugin (0.3.8) - #169

Open
Lumos-789 wants to merge 1 commit into
zai-org:mainfrom
Lumos-789:feat/galadon
Open

Lumos-789 wants to merge 1 commit into
zai-org:mainfrom
Lumos-789:feat/galadon

Conversation

@Lumos-789

@Lumos-789 Lumos-789 commented Nov 4, 2026 •

Copy link
Copy Markdown

Plugin type (required) / 插件类型(必填)

  • UI Plugin / 是 UI 插件 — provides MCP Apps interactive pages / 提供 MCP Apps 交互页面
  • Standard plugin / 普通插件(非 UI) — does not provide MCP Apps interactive pages / 不提供 MCP Apps 交互页面
  • Not applicable / 不适用 — repository-only changes; no plugin content changed / 仅仓库级改动,不涉及插件内容

Affected plugin name(s) / 涉及的插件名称:galadon

What / 改动内容

EN — Adds galadon, a five-stage engineering loop — spec, build, verify, ship, learn — for agent-built projects. The repository is the plugin: a Python CLI plus a skill that keeps the agent on the single next action, with one artifact and one gate per stage.

  • init --layout {none,webapp,service,plugin} --stack {python,node,none} scaffolds a project's internal layering (entry docs, an OpenSpec plan face, a spec/ truth layer, a wiki split, the six .agents/ slots, server+web, scripts/deploy/config, tests, a gitignored out/). It only adds files and never overwrites what a directory already has. The scaffold ships passing tests and real check commands, and non-none layouts also gate the directory contract.
  • Role, template and deploy are ports a project replaces in galadon.yaml (ports.role, ports.template, ports.deploy); the bundle ships a local adapter and an ssh/systemd adapter with release directories, an atomic current/previous switch, a deploy lock, a commit-versioned probe and automatic rollback.
  • ship refuses, before it builds: without a version probe, a spec with an unticked acceptance criterion, a dirty tree, or an environment that is not defined in deploy.envs. A protected environment needs --yes-prod, and teardown only removes a root bootstrap created.
  • galadon.yaml is strict: unknown keys fail loudly, and so does a key left empty where a value is required.

中文 — 新增 galadon:面向 agent 工程的五阶段循环(规格 / 施工 / 验证 / 发布 / 收口),每阶段一个产物一道闸,agent 永远知道下一步该做什么。内置版式与技术栈脚手架生成器、local 与 ssh/systemd 两个部署适配器(版本目录、原子切换、部署锁、探针与自动回滚),角色 / 模板 / 部署端口可在项目内替换,以及严格的配置校验。

Visible behavior and testing / 可见行为与测试

  • python3 -m pytest -q → 227 passed, 121 subtests; node --test tests/test_plugin.mjs → 4 passed (macOS 27.2.1 arm64, Python 3.14.4, Node 24.15.0).
  • 0.3.8 came out of a full review of 0.3.7; sixteen defects, each reproduced before it was fixed. The ones a user meets first: init --force overwrote a project's README, AGENTS.md, .gitignore, spec and config while its help said "add" (it only adds files now); a fresh clone of a scaffolded project failed check because the layout contract asked for .agents/ slots the scaffold's own gitignore keeps out of git (recreated on demand); pip install shipped a CLI whose init had no templates; every loop after the first skipped its retro; an exception from the probe left the release live with no rollback and no record; ship --env prod went to the test host and was recorded as prod.
  • The bash the ssh adapter sends to a host is executed in the suite against a real release tree, with systemctl, flock and chown replaced by logging shims: a first and a later release, a failed restart restoring the previous one, a failed first release removing current, remote_migrate running before the switch, and pruning that never touches the live or the previous release.
  • Cut against the artifact itself: the plugin zip was built with this repository's own build_zip(), which showed every entry landing as 0644 — so a scaffold made from a zip-installed plugin had wrappers that refused to run. Rendering now sets the exec bit by where a file lands; the suite renders from templates with no exec bit at all and runs the generated wrappers.
  • pip install of the repository into a fresh virtualenv: init, check and a git clone round trip pass from the installed CLI.
  • Earlier revision, measured on a real host (0.3.3, an isolated slot reached over an SSH tunnel): ship PASS with HTTP 200 and a matching commit; a release that exits on start was probed 48 times / 15 s, failed, and auto-rolled back, with the post-rollback recheck green. The service needs ~130–170 ms after systemctl restart before the port accepts.
  • Guards exercised for real on that host: bootstrap refuses a non-empty unmarked root and a root owned by another slot (exit 65, before creating user/unit/caddy); a second concurrent ship is rejected by the deploy lock (exit 75).

Not covered by this round / 本轮未覆盖:

  • 0.3.8's remote changes — remote_migrate, release pruning, the first-release rollback, and waiting out 502/503/504 — were not re-run on a real host. The scripts are executed in the suite with shims; the gateway status codes come from the Caddy documentation and are reproduced on the probe client only.
  • No CI in this repository yet; Windows targets and non-systemd init are unexercised. Remote deploys were verified against systemd + Caddy only.

Version and marketplace registration / 版本与市场注册

  • Plugin directory external_plugins/galadon/ (117 files), .zcode-plugin/plugin.json and the marketplace.json entry both at 0.3.8.
  • Category developer-tools; icon added at the repo-root path the entry uses (assets/galadon/icon.png, 512×512).
  • description_i18n carries en and zh-CN, byte-identical between the manifest and the entry; README.md / README_CN.md are both present and kept in step.

Dependencies, network, permissions, side effects / 依赖、网络、权限与副作用

  • Python 3.10+ and PyYAML for the CLI; git for versioned releases.
  • Remote deploys additionally need SSH, rsync, systemd and Caddy on the target; the ssh adapter writes release directories, a systemd unit, a dedicated system user and a Caddy site block.
  • Local side effects: init only adds files under the target root (spec/, wiki/, .agents/, out/). On a remote host it writes release directories plus the unit/user/Caddy block, and after a successful switch deletes the oldest releases beyond keep_releases (default 5) — never the live or the previous one. Every managed site is kept out of search engines (noindex, robots.txt) unless search_index: true. teardown reverses only what bootstrap created.
  • ports.role and ports.deploy load Python modules from the project itself: project code runs on the machine that runs the CLI, exactly as the configured check commands already do.
  • No telemetry and no third-party network calls: the only network traffic is rsync/ssh to the deploy target and the HTTP probe against probe_url.

Licensing / provenance / 许可与来源

  • MIT (LICENSE ships in the plugin directory); code written for this submission.
  • No third-party code or assets bundled; the scaffold templates were extracted from the author's own projects.

Self-check / 自查清单

  • Plugin name is unique kebab-case; new external plugin directory is external_plugins/galadon/; existing fixes retain ownership / 插件名唯一且 kebab-case,外部新增插件位于 external_plugins/galadon/,已有插件修复保留原归属
  • Usage category is set independently of publisher ownership / 用途分类 category 已填写,与维护归属分开:developer-tools
  • Plugin type and affected names are declared above / 已在上方声明插件类型与涉及的插件名称
  • version bumped in BOTH plugin.json and marketplace.json (artifacts are immutable) / plugin.json 与 marketplace.json 两处版本号已同步升级:0.3.8
  • README.md (EN) and README_CN.md (中文) both updated and equivalent / 中英文 README 均已更新且语义一致
  • description_i18n has both en and zh-CN / description_i18n 包含 en 与 zh-CN
  • No secrets, machine-specific paths, or private dependencies / 不含密钥、机器专属路径或私有依赖
  • Model/API/network dependencies documented / 模型、API、网络依赖已写明(见上方依赖小节与两个 README)
  • python3 scripts/validate.py passes on this branch, and the plugin artifact was built through the same build_zip() code path CI uses (size and sha256 in the comment below). The full python3 scripts/build_dist.py needs the repo's UI-plugin pnpm build and fails identically on upstream main (excalidraw: incomplete build), so CI runs it here — see the note above. / 本地 validate.py 通过,本插件产物用 CI 同一条 build_zip() 路径打出(体积与 sha256 见下方评论);完整 build_dist.py 依赖仓库自带 UI 插件的 pnpm build,在 main 上同样失败,交由 CI 执行

@Lumos-789

Copy link
Copy Markdown
Author

0.2.1 — verification (2026-11-04)

Environment: ZCode CLI 0.17.1, macOS 27.0.1 arm64, Python 3.14.4.

Installed from a local marketplace (zcode plugins install galadon@…) → [email protected]. The skill resolves from the plugin cache at ~/.zcode/cli/plugins/cache/…/galadon/0.2.1/skills/galadon/SKILL.md, not from a repo checkout.

Ran the bundled CLI from that installed cache in an empty directory:

Step Result
bin/galadon init --template api --role solo workspace created, phase: spec, one next action
galadon next prints the single next action for the current phase
galadon check with the template spec (still TODO) FAIL spec/spec.md still contains TODO
galadon check without ## Problem FAIL spec/spec.md is missing ## Problem
galadon check without an acceptance checkbox FAIL needs at least one acceptance checkbox
galadon check with a complete spec PASS, and next advanced the phase

Repo-side gates for the same tree: python3 -m pytest tests -q → 41 passed (+3 subtests), node --test tests/test_plugin.mjs PASS, plugin_acceptance.py PASS [email protected], marketplace_check.py OK.

Not covered: remote bootstrap/ship/teardown over SSH (needs a real target host), and --env prod refusal paths — those are exercised by unit tests only.

@Lumos-789

Copy link
Copy Markdown
Author

Addendum — also run inside a real ZCode agent session

Not only the CLI from the cache: a headless ZCode session (sess_e1ac0f61-9da2-405f-b231-a805e1ce6c2f) with the skill forced by its qualified name. The agent found the bundled bin/galadon by itself, ran galadon init --template api --role solo (the first attempt was refused because the directory had auto-generated empty folders — the CLI told it to pass --force, and the agent did), then ran galadon next and reported phase: spec with the single next action. Nothing was run by hand in that session.

@panda920

panda920 commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically.

@Lumos-789 Lumos-789 changed the title feat: add galadon (five-stage engineering loop with deploy ports) feat: add galadon (five-stage engineering loop with layout/stack scaffolding) Nov 4, 2026
@Lumos-789

Copy link
Copy Markdown
Author

Third round — review & simplification (2026-11-05)

No new features. Three things came out of the audit:

1. A documented port did not exist. The README listed four ports — role, template, deploy and tool — and described a local files implementation for the tool port. src/galadon/tools.py contained five protocols with no implementation and no reference anywhere in src/ or tests/. It is gone; the README now says three, matching the code. Three other protocol classes (RolePort, DeployPort, TemplatePort, Gate) and the Ticket.verify per-task override were removed for the same reason: no consumer.

2. 41 byte-identical template copies collapsed into _shared. The three layout profiles carried the same placeholder docs and .gitkeep markers in near-identical copies. They now render from one copy each.

The generated output is byte-identical: I enumerated all 36 profile × layout × stack combinations before the change, re-ran them after, and diffed the trees — the only differences are the two that the change intends (the removed tools: block in galadon.yaml, and a --stack qualifier in the generated layout README). No file was added or removed from any generated project. I also unpacked the published payload on its own and used its init to generate the same combinations, comparing against the repo build: identical.

3. The 0.3.0 capability was missing from every description. plugin.json, .codex-plugin/plugin.json, package.json, pyproject.toml and the skill frontmatter all still described only the five-stage loop, so a marketplace visitor would never learn that init --layout/--stack exists. All five now mention the scaffold generator alongside the five stages.

Also corrected: the layout directory lists in the READMEs and --list-layouts were four separate copies that all omitted src/ (created by the python stack); "init leaves check green" was false for --stack none; the English port table omitted the ssh adapter; the Chinese README said the layering was sampled from one production project — it was three.

Verification: 92 Python tests + 4 Node tests pass; tools/plugin_acceptance.py galadon and the public-release gate are clean; the install → disable → enable → uninstall → reinstall matrix passes for 0.3.0.

Payload: re-synced, 127 files (down from 149 — that is the template de-duplication), verified blob-by-blob against Lumos-789/galadon@dae85a8.

Not verified this round: no end-to-end deploy was run; the change touched templates, docs and unreachable code only.

@panda920

panda920 commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically.

@panda920

panda920 commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically.

@Lumos-789

Copy link
Copy Markdown
Author

Re-pushed the payload at 0.3.1 (5169a21). tools/verify_pr_payload.py galadon:169 → MATCH, 117 files, every blob identical to Lumos-789/galadon@a527132.

Changes since the 0.3.0 payload (884b343):

  • Strict config: galadon.yaml now rejects unknown top-level keys instead of ignoring them. The shipped schema already declared additionalProperties: false, so the retired 0.1.0 tools: block could sit in a real config doing nothing. The error names every unknown key and the allowed set.
  • Docs corrected: with the default none layout the first check failure is the spec gate (spec/spec.md still contains TODO); no checks configured only appears once the spec is complete. README.md, README_CN.md and init --list-layouts had the checks failure described as the first one.
  • Tests 92 → 97 (+ node 4): a standing matrix over all 36 layout × stack × template combinations, asserting each is either green on a fresh scaffold or fails with the specific reason it is expected to produce; and examples/minimal — shipped in the tarball, previously covered by nothing — must now pass galadon check from a scratch copy.
  • PR body updated: it claimed "tool boundaries are explicit ports" (that port was removed in 0.3.0) and never mentioned the --layout/--stack generator.

@Lumos-789

Copy link
Copy Markdown
Author

0.3.2 — packaging hygiene (2026-11-05)

Payload re-pushed at 0.3.2: head 884b343 → 5169a21 → 6210ff6.
tools/verify_pr_payload.py galadon:169 → MATCH, 117 files, every blob identical to Lumos-789/galadon@aecd75a.

What was wrong. Re-running the suite from a clean tree, the bytecode test came up red:

  1. pytest from the repo root roamed into examples/, collected examples/minimal/tests/test_health.py — the 98th test — and imported the example's server.py.
  2. That wrote __pycache__ inside examples/minimal/, a directory that ships in the npm tarball.
  3. package.json files is an allowlist and overrides .npmignore, so the bytecode test's own subject (the .pyc files) rode into the package. The __pycache__/ lines in .npmignore are dead for allowlisted directories.
  4. npm test stayed green because unittest discovery already lives in tests/; the failure surfaced only on the pytest path. So the previous "97 + 4 green" was order-dependent — it held only if nothing had run pytest first.

Fix.

  • pyproject.toml: [tool.pytest.ini_options] testpaths = ["tests"] — pytest stays in tests/. Example coverage is not lost: BundledExampleTests runs the example's own galadon check from a scratch copy.
  • package.json: prepack removes __pycache__ and *.pyc, so the tarball no longer depends on what happened to run in the tree before packing.

Evidence.

Check Result
pytest collected tests 98 → 97 (the extra was the example test)
.pyc under examples/ after a pytest run 0
node --test immediately after pytest 4/4 pass
2 .pyc planted, then npm pack --dry-run tarball bytecode entries 0, disk cleaned
npm test 97 py + 4 node, exit 0
marketplace_check / simplify_gate / public_release_gate OK zcode=6 codex=4 / PASS / PASS

Not covered. No npm publish was run — the tarball claim is verified from npm pack --dry-run file lists only. The .npmignore __pycache__/*.pyc lines were left in place; as noted above they do not protect allowlisted directories, and the guard is now prepack plus the test.

@Lumos-789

Copy link
Copy Markdown
Author

0.3.3 — deploy-path hardening (2026-11-05)

Payload re-pushed at 0.3.3: head 6210ff6 → 81f60a8.
tools/verify_pr_payload.py galadon:169 → MATCH, 117 files, every blob identical to Lumos-789/galadon@0d49ecc.

Everything below came from running the loop end to end against a real host — an isolated slot (/srv/galadon-e2e, own systemd unit, own Caddy marker, own port) with the probe going through an SSH tunnel to loopback, so no port was exposed and nothing was left behind.

1. The probe judged a service that had not started yet. systemctl restart returns once the process is spawned, not once it listens; measured on the host, the port refused connections for 130–170 ms afterwards. The single-shot probe fired inside that window, so both shipments of a real project failed and rolled back (2/2). The same zero tolerance made a rollback that had restored service report itself as failed, because the post-rollback re-check used the same probe. Connection-level failures now retry inside a bounded 15s readiness window (adapters/probe.py, shared by local and ssh); an HTTP answer is final and still goes through the commit check; a target that never answers fails loudly with the attempt count — 48 attempts over 15s in the observed failure.

2. bootstrap adopted directories it did not own. It ran install -d on whatever remote_root it was given and wrote its ownership marker into it, so a directory holding someone else's data became a galadon root — and teardown then deleted it, because the marker it checks was planted by that bootstrap. Reproduced: a foreign important.txt was destroyed. It now refuses a non-empty unmarked directory, and a root carrying another slot's marker, before touching the user, the unit or Caddy.

3. teardown died on a shared run user. The default galadon user is shared by every slot; userdel fails while any other slot still runs as it — the normal state on a host with two deployments — and the failure happened after rm -rf root. It now leaves the user in place, says why, and reports user_skip_reason, while still failing loudly if the user cannot be removed for any other reason.

4. ship stamped HEAD on an artifact built from the working tree. Uncommitted changes shipped under a commit they were not part of, so a later rollback could restore a version that never existed. ship now refuses and names the files, exempting the loop's own generated files (AGENTS.md phase block, evidence, the release record, .galadon/).

5. ship --dry-run --env prod required --yes-prod — previewing a production release demanded the flag that authorises one. Preview is now allowed and prints requires: --yes-prod; a real prod run still requires it.

Scenario (real host) Result
bootstrap twice idempotent — unit_changed: false, changed: false
first ship, empty root PASS, previous empty
second ship, new commit PASS, previous = prior release
broken artifact 48 attempts / 15 s → FAIL, automatic rollback, re-probe HTTP 200
probe_expect unsatisfiable probe body missing expected text: <commit> <marker> → rollback
two concurrent ships second refused exit 75 (deploy lock), first PASS, links consistent
bootstrap into a foreign root refused exit 65, data intact, nothing provisioned
teardown with two slots live exit 0, user_removed: false + user_skip_reason
dirty tree refused, naming src/galadon_relay/app.py
local adapter, full loop check → ship → rollback verified

Tests: 97 → 109 (readiness window, dirty-tree guard, bootstrap/teardown guards, prod preview) plus the node suite 4/4. marketplace_check, simplify_gate and public_release_gate pass; the host was torn down and verified clean afterwards.

A blind spot worth stating. The probe trusts a marker the build writes, so a build that refreshes commit.txt without refreshing the code passes the probe. That is exactly what happened in this project's own dogfood app: cp -r src/x dist/x nests once the destination exists, so from the second build on the top-level package stayed stale while the marker was new. Fixed there (rm -rf dist first), but the general shape remains: only probe_expect — asserting content the new build alone can emit — catches it.

Not covered. No npm publish; the Caddy/DNS front path was not exercised (the original test slot no longer resolves, which is why probes ran over a tunnel); and the rollback chain is one level deep by design — after a rollback previous equals current, deliberately, since pointing it at the failed release would let a second failure roll back onto a known-broken build.

@Lumos-789 Lumos-789 changed the title feat: add galadon (five-stage engineering loop with layout/stack scaffolding) feat(galadon): add the five-stage engineering loop plugin (0.3.3) Nov 5, 2026
@Lumos-789

Copy link
Copy Markdown
Author

Re-pushed this branch as b9eb0a6f and fixed two classes of defect that were ours, not the repository's. Nothing about the plugin's behaviour changed.

1. The PR now follows .github/PULL_REQUEST_TEMPLATE.md. The body had drifted into hand-written prose and lost the two parts a reviewer checks first: the Plugin type declaration and the Self-check list. Both are back, the five sections CONTRIBUTING asks for are filled in (problem / visible behaviour and testing / version and marketplace registration / dependencies and side effects / licensing), and the title carries the (<plugin-name>) scope the template requires for the squash commit on main.

2. The entry named the repo-root assets/galadon/icon.png, but that file was never uploaded with the branch — the catalogue would have shown a broken icon. It is committed now (512×512) and the entry uses the same absolute CDN form as every other icon-bearing entry in marketplace.json.

Re-verified against the branch itself (not a local checkout):

check result
python3 scripts/validate.py @ b9eb0a6f OK: 53 plugin(s) validated
plugin artifact via build_zip() — the same code path CI runs 103331 B, sha256 620d3b0c704b9bea177e5b028ac4d219e2e56bce7d6486b49d1d9edcbe62d0cb
assets/galadon/icon.png present, 512×512
README.md + README_CN.md in the payload both present

Request: the earlier validate status was bound to 81f60a8f, so it is stale after this push. Could you re-run the external validation on b9eb0a6f? The full build_dist.py still needs the repository's UI-plugin pnpm build and fails identically on main (excalidraw: incomplete build; run pnpm build first), which is why I am relying on CI for that step.

中文摘要:本轮只补元数据与载荷完整性 —— 恢复了模板要求的插件类型声明与自查清单、标题加上 (插件名) scope(模板说明该标题会成为 main 上的 squash commit)、把条目引用的根级图标真正提交并以 CDN 绝对地址引用。分支上 validate.py 通过,插件产物按 CI 同一代码路径打包成功(体积与 sha256 见上表)。旧的 validate 状态绑定在 81f60a8f 上已失效,请在 b9eb0a6f 上重跑一次校验。

@Lumos-789 Lumos-789 changed the title feat(galadon): add the five-stage engineering loop plugin (0.3.3) feat(galadon): add the five-stage engineering loop plugin (0.3.4) Nov 8, 2026
@Lumos-789

Copy link
Copy Markdown
Author

Update: payload bumped to 0.3.4 (head 4b0b298). Payload refreshed to the current main repo (byte-identical, verified MATCH). This round is a behavior-preserving cleanup: redundant comments and dead code removed, docs re-aligned with the code. Full test suite, packaging gates (plugin acceptance / simplify / public release) and the install lifecycle matrix all pass locally.

@Lumos-789 Lumos-789 changed the title feat(galadon): add the five-stage engineering loop plugin (0.3.4) feat(galadon): add the five-stage engineering loop plugin (0.3.5) Nov 12, 2026
@Lumos-789

Copy link
Copy Markdown
Author

0.3.5 — fresh-eyes review round, every defect reproduced first.

  • The dirty-tree guard read git status with untracked files hidden, so a brand-new file could ride along on a release (the exact scenario the guard exists for) → untracked files are now included; the scaffold's own gitignore keeps generated dirs out.
  • A local rollback with a static probe_expect was falsely reported failed (the recheck compared against the release version instead of the expected marker) → the recheck now uses the same comparison the release gate uses.
  • The ssh preflight silently dropped the unit-drift check when bootstrap keys were incomplete → now prints a named skip with the missing keys.
  • --list-layouts claimed a shell-check suffix for layouts that have none → the listing now matches the generated check commands byte for byte.
    Tests: 117 passed (was 109) + node 4. Manifest + marketplace entry at 0.3.5.

@panda920

Copy link
Copy Markdown
Collaborator

Thanks for the contribution! This PR no longer applies cleanly on top of the latest main (conflicts in: marketplace.json). Please rebase onto main and push again; it will be picked up automatically.

🤖 Copy this prompt into Claude Code / Codex to fix it
You are updating my pull request #169 to github.com/zai-org/zcode-plugins (the ZCode plugin marketplace).
The maintainers' automated intake reported: the PR conflicts with the latest main

Conflicting files: marketplace.json

Fix it in this repository:
- New external plugins belong under external_plugins/<my-plugin>/; keep existing plugins in their current directory;
  never modify .github/, scripts/, tests/, .gitignore, .gitattributes or AGENTS.md.
- Follow CONTRIBUTING.md and AGENTS.md: the manifest lives at <plugin-directory>/.zcode-plugin/plugin.json,
  its name/version must match marketplace.json, names are kebab-case, keep the required i18n fields.
- Fetch the latest main of zai-org/zcode-plugins and rebase onto it; if marketplace.json conflicts,
  keep every existing entry and re-add mine.
- Run `python scripts/validate.py` until it passes, then force-push my PR branch.

@panda920

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically.

@Lumos-789 Lumos-789 changed the title feat(galadon): add the five-stage engineering loop plugin (0.3.5) feat(galadon): add the five-stage engineering loop plugin (0.3.6) Nov 17, 2026
@Lumos-789

Copy link
Copy Markdown
Author

Payload refreshed to 0.3.6: new 1-bit monochrome pixel icon (a shared pixel-art family across our six plugins) plus version bump; rebased as a single commit onto current upstream main, payload blobs reused byte-for-byte. Source: Lumos-789/galadon.

@panda920

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically.

@Lumos-789 Lumos-789 changed the title feat(galadon): add the five-stage engineering loop plugin (0.3.6) feat(galadon): add the five-stage engineering loop plugin (0.3.7) Nov 18, 2026
@Lumos-789

Copy link
Copy Markdown
Author

Review-fix round — 0.3.7 (payload refreshed to Lumos-789/galadon@68f1b73):

  • All version sources realigned on 0.3.7, with a drift test to keep them there. galadon.__version__ and pyproject.toml were still on 0.3.5 after the 0.3.6 icon round bumped only the manifests and package.json; a new version-consistency test now fails the suite when any source drifts again.
  • The ssh adapter's release step now prefers DeployContext.commit instead of re-reading git itself — a commit pinned on the context by the caller could disagree with the release name and the probe expectation. It falls back to the commit provider only when the context has none, the same precedence the local adapter uses.
  • The byte-identical deploy/README.md is deduped into the _shared layout layer. It shipped twice (service and webapp layouts), so a fix could land in one copy and leave the other stale; scaffolds now render the same layout-level README through the shared layer.
  • Dropped a dead description=__doc__ argument from the parser — cli.py has no module docstring, so the description was always None.

Tests (re-run for this release): 119 passed, 71 subtests (python3 -m pytest -q) and node 4/4 pass (npm test). Release gates all green. Version: 0.3.7.

@panda920

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically.

@Lumos-789

Copy link
Copy Markdown
Author

Rebased onto the latest main (five new official plugins landed upstream): single-commit rebuild, payload blobs reused byte-for-byte, marketplace entry re-inserted with every upstream entry kept. Payload verified against the source repo (byte-identical) and scripts/validate.py passes on the new head. No plugin behaviour changed — same version, same content.

@panda920

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically.

@panda920

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically.

@Lumos-789 Lumos-789 changed the title feat(galadon): add the five-stage engineering loop plugin (0.3.7) feat(galadon): add the five-stage engineering loop plugin (0.3.8) Nov 26, 2026
@Lumos-789

Copy link
Copy Markdown
Author

Payload re-pushed at 0.3.8: head 5e71b13 → 12beb2e, a single commit on upstream main (7c976c6). tools/verify_pr_payload.py galadon:169 → MATCH, 117 files, every blob identical to Lumos-789/galadon@cc1d4b5.

0.3.8 — a full review of 0.3.7. Sixteen defects, each reproduced before it was fixed. The ones a user meets first:

  • init --force overwrote a project's own files. README.md, AGENTS.md, .gitignore, the spec and galadon.yaml were replaced by templates while the flag's help said "add". init only adds files now and lists what it kept.
  • A fresh clone failed check. The layout contract asked for six .agents/ slots that the scaffold's own .gitignore keeps out of git, so every clone — a colleague, CI, a new machine — was red. They are recreated on demand.
  • pip install shipped a CLI with no templates, so its init could not run. The templates are part of the package.
  • Every loop after the first skipped its retro: new left the previous one in place and it satisfied the next learn gate.
  • An exception from the probe left the release live, with no rollback and no record, and a failed first release stayed on current. Any probe or rollback failure now rolls back, is recorded and exits non-zero; a first release that fails leaves nothing live.
  • The readiness window missed the reverse proxy. It retried a refused connection but took 502/503/504 as final — what Caddy answers while the restarted upstream is not listening yet.
  • ship --env prod went to the test host and was recorded as prod. deploy.envs gives each environment its own target and probe; an undefined environment is an error, and an environment is protected by protected: true or a prod prefix.
  • ship now refuses before it builds on an unticked ## Acceptance criterion or an unusable probe config. --dry-run runs nothing and writes nothing. A green check is bound to the commit and the uncommitted files it ran against, so next returns to verify when the project changes afterwards — but not when the checked work is merely committed.
  • git that could not answer read as a clean tree, and a folder untracked by an enclosing repository took that repository's commit. Both are explicit now.
  • Smaller: an empty YAML key was read as the string "None"; checks.timeout accepted anything; a failing check hid stderr; next rewrote AGENTS.md and a state.json nobody read; the shipped JSON schema was unused and already out of step with the loader, and is gone.

The ports are real. The README has promised replaceable ports since 0.1.0 while every port was a hard-coded branch. ports.role, ports.template and ports.deploy load a project's own role policy, template tree and DeployPort, and the loader checks each against its contract.

ssh adapter: options.remote_migrate (on the host, inside the new release, before the switch), options.environment_file, options.keep_releases (default 5, never the live or the previous release), options.probe_ready_seconds, and options.search_index — bootstrap keeps every managed site out of search engines, which was never documented until now.

Two more found while cutting this release, both against the artifact itself

  • The marketplace zip carries every entry as 0644, templates included, and rendering copied that mode. A scaffold made from a zip-installed plugin had bin/<project>, scripts/dev.sh and scripts/quality-check.sh that refused to run, while check stayed green because nothing executes them. The wrappers are executable by where they land now.
  • Moving the templates into the package made two package.json files entries overlap. The package directory is listed once, and a test keeps the entries disjoint.

Tests: python3 -m pytest -q → 227 passed, 121 subtests; node --test tests/test_plugin.mjs → 4 passed. The bash the ssh adapter sends to a host is now executed in the suite against a real release tree, with systemctl/flock/chown replaced by logging shims.

Verified on this branch (ZCode CLI 0.18.0, macOS 27.2.1 arm64, Python 3.14.4, Node 24.15.0):

check result
python3 scripts/validate.py @ 12beb2e, the branch's own script on the complete branch tree OK: 59 plugin(s) validated
plugin artifact through the branch's own build_zip() 280930 B, sha256 48862970ec138dcf7c75e034ba173204d4a31cd48403ec1799bf3b15cb508cef
that artifact, unzipped (117 files, none executable) bash bin/galadon init → the generated bin/demo, scripts/dev.sh, scripts/quality-check.sh are executable and run; check PASS
install / update / disable / enable / uninstall / reinstall, local directory marketplace PASS — 0.3.8, old cache removed, cache byte-identical to the payload (117 files)
skill, explicit invocation, headless session sess_48beec8f-c2a3-40c7-a0be-1c2e44b3d263 Skill called with galadon:galadon, loaded from the 0.3.8 plugin cache
bundled CLI from the installed cache init → next → check PASS; a fresh clone passes check; a real ship with a local probe PASS; a failed probe rolled back to the previous release, exit 1
failure paths, installed CLI unticked acceptance 2 · undefined --env 2 · no probe 2 (nothing released) · init without --force 2, with it existing files kept · broken source 1 (reason shown) · bad timeout 2
pip install of the source into a fresh virtualenv init, check and a clone round trip PASS

Not verified: the 0.3.8 remote changes (remote_migrate, pruning, the first-release rollback, waiting out 502/503/504) were not re-run on a real host — the scripts are executed with shims, and the gateway status codes are reproduced on the probe client only, not against a live Caddy. The natural-language skill trigger was not exercised cleanly: two attempts on this machine were answered from other context without the skill. No CI in the repository; Windows and non-systemd init are unexercised.

PR body refreshed — it still claimed 117 tests, a shipped schema and version 0.3.5.

@panda920

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants